package com.kay.controller;

import com.kay.framework.annotation.Autowired;
import com.kay.framework.annotation.Controller;
import com.kay.framework.annotation.RequestMapping;
import com.kay.framework.annotation.Security;
import com.kay.service.MyService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Description:
 * @Author: Kay
 * @CreateDate: 2021/7/12$ 16:59$
 * @UpdateUser: Kay
 * @UpdateDate: 2021/7/12$ 16:59$
 */
@Controller
@RequestMapping("/security")
@Security({"zhangShan","liSi"})
public class SecurityController {

    @Autowired
    private MyService myService;

    @Security({"liSi"})
    @RequestMapping("/myTest01") // liSi 有访问  http://localhost:8080/security/myTest01 的权限
    public String myTest(HttpServletRequest request, HttpServletResponse response, String name){
        return myService.myTest(name);
    }

    @Security({"zhangShan"})
    @RequestMapping("/myTest02") // zhangShan 有访问  http://localhost:8080/security/myTest02 的权限
    public String myTest02(String name){
        return myService.myTest(name);
    }
}
